/**
 * 
 */
package com.youth.fund.hk.hostManager.manager.dao.mybatis;

import java.sql.Timestamp;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.youth.fund.hk.hostManager.common.dao.mybatis.BaseMybatisDao;
import com.youth.fund.hk.hostManager.manager.dao.InvestorEducationTypeDao;
import com.youth.fund.hk.hostManager.manager.datamodel.InvestorEducationTypeModel;

/**
 * @author Sunk_Sky
 *
 * 2014年11月12日下午5:09:20
 */
@Repository("InvestorEducationTypeDao")
public class InvestorEducationTypeMybatisDaoImpl extends
		BaseMybatisDao<InvestorEducationTypeModel, Integer> implements
		InvestorEducationTypeDao
{

	private final static String CREATE = "investor_education_type.create";

	private final static String DELETE = "investor_education_type.delete";

	private final static String UPDATE = "investor_education_type.update";

	private final static String QUERY_BY_CONDITION = "investor_education_type.list_by_condition";

	/* (non-Javadoc)
	 * @see com.youth.fund.hk.hostManager.common.dao.ICommonDao#create(java.io.Serializable)
	 */
	@Override
	public boolean create(InvestorEducationTypeModel model)
	{
		Timestamp timestamp = new Timestamp(System.currentTimeMillis());

		model.setSetup_time(timestamp);

		model.setUpdate_time(timestamp);

		return super.create(model, CREATE);
	}

	/* (non-Javadoc)
	 * @see com.youth.fund.hk.hostManager.common.dao.ICommonDao#delete(java.io.Serializable)
	 */
	@Override
	public boolean delete(InvestorEducationTypeModel model)
	{
		return super.delete(model, DELETE);
	}

	/* (non-Javadoc)
	 * @see com.youth.fund.hk.hostManager.common.dao.ICommonDao#update(java.io.Serializable)
	 */
	@Override
	public boolean update(InvestorEducationTypeModel model)
	{
		Timestamp timestamp = new Timestamp(System.currentTimeMillis());

		model.setUpdate_time(timestamp);
		
		return super.update(model, UPDATE);
	}

	/* (non-Javadoc)
	 * @see com.youth.fund.hk.hostManager.common.dao.ICommonDao#query(java.io.Serializable)
	 */
	@Override
	public List<InvestorEducationTypeModel> query(
			InvestorEducationTypeModel model)
	{
		return super.query(model, QUERY_BY_CONDITION);
	}

	/* (non-Javadoc)
	 * @see com.youth.fund.hk.hostManager.common.dao.ICommonDao#queryOne(java.io.Serializable)
	 */
	@Override
	public InvestorEducationTypeModel queryOne(InvestorEducationTypeModel model)
	{
		return super.queryOne(model, QUERY_BY_CONDITION);
	}

}
